# Этап компиляции
FROM golang:alpine AS build-env

WORKDIR /go/src/app

COPY . .

RUN go build -o ./bin/rootsOfPast ./main.go

# Этап запуска
FROM alpine

WORKDIR /usr/bin

COPY --from=build-env /go/src/app/bin .
COPY ./cfg /usr/share/rootsOfPast
COPY ./mkcert /usr/share/rootsOfPast/mkcert

EXPOSE 3443/tcp

ENTRYPOINT ["/usr/bin/rootsOfPast"]
